/*******************************************************************************
 * Copyright (c) 2016, 2025 Lablicate GmbH.
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 * Philip Wenig - initial API and implementation
 *******************************************************************************/
package org.eclipse.chemclipse.csd.converter.supplier.arw.core;

import java.io.File;

import org.eclipse.chemclipse.converter.core.AbstractMagicNumberMatcher;
import org.eclipse.chemclipse.converter.core.IMagicNumberMatcher;

public class MagicNumberMatcher extends AbstractMagicNumberMatcher implements IMagicNumberMatcher {

	private static final byte[] MAGIC_CODE_DAD = new byte[]{0x57, 0x61, 0x76, 0x65, 0x6C, 0x65, 0x6E, 0x67, 0x74, 0x68};

	@Override
	public boolean checkFileFormat(File file) {

		if(checkFileExtension(file, ".arw")) {
			return !checkMagicCode(file, MAGIC_CODE_DAD);
		}

		return false;
	}
}